<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="__TMPL__Public/assets/book_static/css/base.css" />
<link rel="stylesheet" href="__TMPL__Public/assets/book_static/css/info-reg.css" />
<script type="text/javascript" src="__TMPL__Public/assets/book_static/js/jquery.js"></script>
<script type="text/javascript" src="__TMPL__Public/assets/layui/layui.js"></script>
<title>图书库存管理系统</title>
</head>

<body>
<div class="title"><h2>快速出库</h2></div>
<div class="main">
	<p class="short-input ue-clear">
    	<label>ISBN：</label>
        <input type="text" name="isbn" id="isbn" value="{$bookinfo.isbn}" />
    </p>
	<p class="short-input ue-clear">
    	<label>数量：</label>
        <input type="text" name="booknum" id="booknum" value="" />
    </p>
</div>
<div class="btn ue-clear">
	<a href="javascript:void(0);addbook();" class="confirm">确定</a>
</div>
</body>
<script type="text/javascript" src="__TMPL__Public/assets/book_static/js/common.js"></script>
<script type="text/javascript" src="__TMPL__Public/assets/book_static/js/WdatePicker.js"></script>
<script type="text/javascript">

function addbook(){
	var isbn = $("#isbn").val();
	var booknum = $("#booknum").val();
	var location = $("#location").val();
	if(isbn.length>16){
		alert("isbn号错误！");
		return;
	}
	
	$.ajax( {  
		url:"{:U('index/chuku_one_action')}",
		data:{  
			 isbn:isbn,
			 booknum:booknum
		},  
		type:'post',  
		cache:false,  
		dataType:'text',  
		success:function(data) {  
			var index = parent.layer.getFrameIndex(window.name); 
			if(data=="1" ){
				parent.layer.msg('出库成功！', {icon:1,shade: 0.3});
				parent.layer.close(index);
				window.location.href="{:U('index/list_book')}";
			}else{
				parent.layer.msg('出库失败！', {icon:2,shade: 0.3});
				parent.layer.close(index);
			}  
		 }
	});

}
</script>
</html>
